/**
 * Created by Francis.LW on 2017/10/20.
 *
 * 表单项服务接口
 */
import {postRequest, getRequest} from '@/common/request'
import {urls} from './url'

const formTemplateConfigApi = urls.formTemplateConfig

function listAll(param, success, complete) {
  postRequest(formTemplateConfigApi.listAll, {}, param, success, complete)
}

function listFormTemplateConfig(param, page, pageSize, success, complete) {
  postRequest(formTemplateConfigApi.listFormTemplateConfig + '?currentpage=' + page + '&pagesize=' + pageSize, {}, param, success, complete)
}

function getFormTemplateConfig(id, success, complete) {
  getRequest(formTemplateConfigApi.getFormTemplateConfig + id, {}, success, complete)
}

function removeFormTemplateConfig(ids, success, complete) {
  postRequest(formTemplateConfigApi.removeFormTemplateConfig, {}, ids, success, complete)
}

function deleteSingleFormTemplateConfig(id, success, complete) {
  let ids = []
  ids.push(id)
  removeFormTemplateConfig(ids, success, complete)
}

export default {
  listAll,
  listFormTemplateConfig,
  getFormTemplateConfig,
  removeFormTemplateConfig,
  deleteSingleFormTemplateConfig
}
